{% extends 'base.html' %}
{% block title %}编辑任务{% endblock %}
{% block css %}

    <!-- Theme style -->

    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->

    <link rel="stylesheet" href="../static/plugins/messenger/messenger-theme-future.css">
    <link rel="stylesheet" href="../static/plugins/messenger/messenger.css">
{% endblock %}


{% block content %}
{% block  section%}

{% endblock %}
    <!-- Main content -->


    <section class="content">


        <div class="row">
            <div class="col-md-6">
                <div class="box box-danger">

                    <!-- /.box-header -->
                    <form class="form-horizontal " id="task_form" action="/edit_task?task_type={{ task_type }}" method='POST'>

                        <div class="box-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">任务名称</label>

                                <div class="col-sm-10">
                                    <input type="text" name="task_name" class="form-control" placeholder="任务名称"
                                           value="{{ task_args['task_name'] }}" readonly="readonly">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">扫描IP</label>

                                <div class="col-sm-10">
                                    <textarea rows="4" class="col-sm-12" name="task_ips"
                                              placeholder="仅支持192.168.1.1-192.168.1.254和192.168.1.1格式"
                                              required>{{ task_args['task_ips'] }}</textarea>
                                </div>
                            </div>
                            {% block div %}

                            {% endblock %}
                            <div class="form-group ">
                                <label class="col-sm-2 control-label">循环周期</label>
                                <div class="col-sm-4">
                                    <input name="job_time" type="text" class="form-control"
                                           placeholder="支持小数点，如：0.1" value="{{ task_args['job_time'] }}" required>
                                </div>
                                <div class="col-sm-6">

                                    <select class="form-control" name="job_unit">
                                        {% if task_args["job_unit"]=="hours" %}
                                            <option value="hours" selected="selected">小时</option>
                                        {% else %}
                                            <option value="hours">小时</option>
                                        {% endif %}

                                        {% if task_args["job_unit"]=="days" %}
                                            <option value="days" selected="selected">天</option>
                                        {% else %}
                                            <option value="days">天</option>
                                        {% endif %}



                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">IP白名单</label>

                                <div class="col-sm-10">
                                    {% if task_args["white_ip"] %}

                                        <textarea rows="20" class="col-sm-12"
                                                  name="white_ip">{{ task_args["white_ip"] }}</textarea>
                                    {% else %}

                                        <textarea rows="20" class="col-sm-12" name="white_ip"
                                                  placeholder="排除扫描的IP，一行一个，如：&#13;&#10;192.168.1.123&#13;&#10;192.168.1.200-192.168.2.123"></textarea>
                                    {% endif %}

                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                        <!-- /.box-body -->
                        <div class="box-footer">

                            <button type="submit" id="task_submit" class="btn btn-info pull-right">提交</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                    <!-- /.box-body -->

                </div>
                <!-- /.box -->


            </div>
            <!-- /.col -->

            <!-- /.col -->
        </div>


        <!-- Default box -->

        <!-- /.box-body -->

    </section>





    <!-- /.content -->

{% endblock %}







{% block script %}

    <script src="static/plugins/messenger/messenger.min.js"></script>


    <!-- FastClick -->
    <script src="static/plugins/fastclick/fastclick.js"></script>
    <!-- AdminLTE App -->
    <script src="static/dist/js/app.min.js"></script>
    <!-- DataTables -->
    {#    <script src="static/plugins/datatables/jquery.dataTables.min.js"></script>#}
    <script src="static/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="static/plugins/datatables/dataTables.bootstrap.min.js"></script>
    <script>
        Messenger.options = {
            extraClasses: 'messenger-fixed messenger-on-bottom messenger-theme-air messenger-on-right'
        }

    </script>

{% endblock %}